{% extends "base.html" %}
{% load url from future %}

{% block content %}

<h3>Usu&aacute;rios do Sistema</h3>

<br />

<a class="btn btn-success" href="/usuario"><i class="icon-plus icon-white"></i>  Novo Usu&aacute;rio</a>

<br /><br />

{% if usuarios %}
    <table class="table table-striped table-bordered">
        <thead>
            <tr>
              <th>Usu&aacute;rio</th>
              <th>Nome/Razão Social</th>
              <th>E-mail</th>
              <th>Revenda</th>
              <th>Revenda ID</th>
              <th>A&ccedil;&otilde;es</th>
            </tr>
        </thead>
        <tbody>
            {% for usuario in usuarios %}
                <tr>
                    <td>{{ usuario.usuario }}
                        {% ifequal usuario.admin "s" %}<a href="#" rel="tooltip" title=" Administrador "><i class="icon-user"></i></a>{% endifequal %}
                        {% ifequal usuario.revenda "s" %}<a href="#" rel="tooltip" title=" Revenda "><i class="icon-shopping-cart"></i></a>{% endifequal %}</td>
                    <td>{{ usuario.nome }}</td>
                    <td>{{ usuario.email }}</td>
                    <td>{{ usuario.fantasia }}</td>
                    <td>{% ifequal usuario.revenda "s" %}{{ usuario.revenda_id }}{% endifequal %}</td>
                    <td><a class="btn btn-danger" href="/remover-usuario/{{ usuario.id }}"><i class="icon-trash icon-white"></i></a>
                        <a class="btn btn-success" href="/usuario/{{ usuario.id }}"><i class="icon-pencil icon-white"></i></a></td>
                </tr>
            {% endfor %}
        </tbody>
    </table>
{% endif %}

{% endblock %}
